package com.dirtylily.myblog.dao;


import com.dirtylily.myblog.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface BlogDao {
//    查
    blog getBlog(Long id);

    List<blog> getAllBlog();

    List<blog> getAllBlogByTypeId(Long id);

    List<blog> getAllBlogByTagId(Long id);


    List<blog> getAllBlogByUpdateTime(Integer num);

    List<blog> getAllBlogFromSomething(blog blog);
    List<blog> getBlogByTitle(String title);

    List<BlogQuery> getAllBlogQuery();

    List<BlogQuery> searchByTitleAndType(SearchBlog searchBlog);

    ShowBlog getShowBlog(Long id );


    //    改
    int  updateBlog(ShowBlog blog);


    //增
    int saveBlog(blog blog);

//更新浏览次数
    int updateViews(Long id);
//    删
    int delBlog(Long id);


    List<blog> getAllBlogByUpdateYear(String year);

    List<String> findGroupYear();

    Long count();

}
